import request from '@/config/axios'
import type { RoomType } from './types'

export const getRoomTypesListApi = (params: any): Promise<IResponse<IResData<RoomType>>> => {
  return request.get({ url: '/room-types', params })
}

export const createRoomTypesApi = (data: Partial<RoomType>): Promise<IResponse> => {
  return request.post({ url: '/room-types', data })
}

export const bulkCreateRoomTypesApi = (data: RoomType[]): Promise<IResponse> => {
  return request.post({ url: '/room-types/bulk', data })
}

export const updateRoomTypesApi = (id: string, data: Partial<RoomType>): Promise<IResponse> => {
  return request.put({ url: `/room-types/id/${id}`, data })
}

export const getRoomTypesDetailApi = (id: string): Promise<IResponse<RoomType>> => {
  return request.get({ url: `/room-types/id/${id}` })
}

export const delRoomTypesListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/room-types/id/${ids[0]}` })
}
